import requests
#获取图片
# res = requests.get('https://res.pandateacher.com/2018-12-18-10-43-07.png')

#判断返回结果，如果为200将图片写出
# if res.status_code == 200:
#       pic = res.content
#       photo = open('D://ppt.jpg','wb')
#       photo.write(pic)
#       photo.close()

# 获取小说
res = requests.get('https://localprod.pandateacher.com/python-manuscript/crawler-html/sanguo.md')
# 判断获取状态，如果为200进行打印
if res.status_code == 200:
      novel = res.text
      k = open('D://《三国演义》.txt','a+')
      k.write(novel)
      k.close
      # print(novel[:800])